package com.mrobuy.jdvc.dao.impl;

import com.mrobuy.jdvc.dao.VCCateFutureDao;
import com.mrobuy.jdvc.entity.VCFeature;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

@Repository("vcCateFutureDao")
public class VCCateFutureDaoImpl implements VCCateFutureDao {

    private static Logger LOG = LoggerFactory.getLogger(VCCateFutureDao.class);

    @Autowired
    private JdbcTemplate jdbcTemplate;

    @Override
    public VCFeature load(String cid) {
        try {
            VCFeature task = (VCFeature)jdbcTemplate.queryForObject("select * from VC_FEATURE where CID = ?", new Object[]{cid}, new BeanPropertyRowMapper(VCFeature.class));
            return task;
        } catch (Exception e) {
            LOG.error(e.getMessage());
        }

        return null;
    }

}
